package com.example.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: my-spring-boot
 * @description: 测试读取配置文件参数
 * @author: JackDong
 * @create: 2018-04-09 16:39
 **/
@RestController
public class MiyaController {

    @Value("${my.name}")
    private String name;
    @Value("${my.age}")
    private int age;

    @ApiOperation(value="读取配置文件", notes="读取配置文件")
    @RequestMapping(value = "/miya",method = RequestMethod.GET)
    public String miya(){
        return name + ":" + age;
    }
}
